package org.cpoy.ei.session;

import org.cpoy.eims.entity.*;
import java.util.ArrayList;
import java.util.List;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityHome;

@Name("addressHome")
public class AddressHome extends EntityHome<Address> {

	public void setAddressId(Integer id) {
		setId(id);
	}

	public Integer getAddressId() {
		return (Integer) getId();
	}

	@Override
	protected Address createInstance() {
		Address address = new Address();
		return address;
	}

	public void load() {
		if (isIdDefined()) {
			wire();
		}
	}

	public void wire() {
		getInstance();
	}

	public boolean isWired() {
		return true;
	}

	public Address getDefinedInstance() {
		return isIdDefined() ? getInstance() : null;
	}

	public List<Teacher> getTeachersForPresentAddressId() {
		return getInstance() == null ? null : new ArrayList<Teacher>(
				getInstance().getTeachersForPresentAddressId());
	}

	public List<StudentPreviousAcadDetails> getStudentPreviousAcadDetailses() {
		return getInstance() == null ? null
				: new ArrayList<StudentPreviousAcadDetails>(getInstance()
						.getStudentPreviousAcadDetailses());
	}

	public List<Teacher> getTeachersForPermanentAddressId() {
		return getInstance() == null ? null : new ArrayList<Teacher>(
				getInstance().getTeachersForPermanentAddressId());
	}

	public List<Parent> getParents() {
		return getInstance() == null ? null : new ArrayList<Parent>(
				getInstance().getParents());
	}

}
